Information Extraction for Unstructured Text Documents

ABSTRACT

Training and using a machine learning model for data extraction is provided. The method comprises receiving keys of interest received from a user through an interface and receiving a batch of documents containing unstructured text. Unstructured text of a first document is processed to extract structured text. The model predicts text classifications of the structured text according to the keys of interest. The predicted text classifications are output to the user through the interface. Annotations to correct any incorrect predictions are received from the user, and the model is retrained according to the annotations. The above steps are repeated for less than ten additional documents from the batch until the model has been trained to predict text classifications with a specified level of accuracy. The trained model then classifies extracted structured text in the remaining documents in the batch.

BACKGROUND INFORMATION 1. Field

The present disclosure relates generally to an improved computingsystem, and more specifically to a method of extracting user-specificdata from unstructured text documents.

2. Background

Many documents contain text in the form of unstructured text data. Whendealing with large volumes of such documents, automated extraction isoften the only feasible way to access and make practical use of suchunstructured text data.

Therefore, it would be desirable to have a method and apparatus thattake into account at least some of the issues discussed above, as wellas other possible issues.

SUMMARY

An illustrative embodiment provides a computer-implemented method fortraining and using a machine learning model for data extraction. Themethod comprises receiving input of a number of keys of interest from auser through an interface and receiving input of a batch of documentscontaining unstructured text. The unstructured text of a first documentfrom the batch is processed to extract structured text. The machinelearning model then predicts text classifications of the structured textaccording to the keys of interest. The predicted text classificationsare output to the user through the interface. Annotations to correct anyincorrect predictions are received from the user through the interface,and the machine learning model is retrained according to theannotations. The above steps are repeated for less than ten additionaldocuments from the batch until the machine learning model has beentrained to predict text classifications with a level of accuracyspecified by the user. The trained machine learning model thenclassifies extracted structured text in the remaining documents in thebatch of documents.

Another illustrative embodiment provides a system for training and usinga machine learning model for data extraction. The system comprises astorage device configured to store program instructions and one or moreprocessors operably connected to the storage device and configured toexecute the program instructions to cause the system to: a) receiveinput of a number of keys of interest from a user through an interface;b) receive input of a batch of documents containing unstructured text;c) process the unstructured text of a first document from the batch ofdocuments to extract structured text; d) predict, with the machinelearning model, text classifications of the structured text according tothe keys of interest; e) output, through the interface, the predictedtext classifications to the user; f) receive, through the interface,annotations from the user to correct any incorrect predictions; g)retrain the machine learning model according to the annotations; h)repeat steps c) through g) for less than ten additional documents fromthe batch of documents until the machine learning model has been trainedto predict text classifications with a level of accuracy specified bythe user; and i) classify, with the trained machine learning model,extracted structured text in the remaining documents in the batch ofdocuments.

Another illustrative embodiment provides a computer program product fortraining and using a machine learning model for data extraction. Thecomputer program product comprises a computer-readable storage mediumhaving program instructions embodied thereon to perform the steps of: a)receiving input of a number of keys of interest from a user through aninterface; b) receiving input of a batch of documents containingunstructured text; c) processing the unstructured text of a firstdocument from the batch of documents to extract structured text; d)predicting, with the machine learning model, text classifications of thestructured text according to the keys of interest; e) outputting,through the interface, the predicted text classifications to the user;f) receiving, through the interface, annotations from the user tocorrect any incorrect predictions; g) retraining the machine learningmodel according to the annotations; h) repeating steps c) through g) forless than ten additional documents from the batch of documents until themachine learning model has been trained to predict text classificationswith a level of accuracy specified by the user; and i) classifying, withthe trained machine learning model, extracted structured text in theremaining documents in the batch of documents.

The features and functions can be achieved independently in variousembodiments of the present disclosure or may be combined in yet otherembodiments in which further details can be seen with reference to thefollowing description and drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The novel features believed characteristic of the illustrativeembodiments are set forth in the appended claims. The illustrativeembodiments, however, as well as a preferred mode of use, furtherobjectives and features thereof, will best be understood by reference tothe following detailed description of an illustrative embodiment of thepresent disclosure when read in conjunction with the accompanyingdrawings, wherein:

FIG. 1 is a pictorial representation of a network of data processingsystems in which illustrative embodiments may be implemented;

FIG. 2 is a block diagram of a document processing system for key-valueextraction depicted in accordance with an illustrative embodiment;

FIG. 3 depicts a diagram illustrating a node in a neural network inwhich illustrative embodiments can be implemented;

FIG. 4 depicts a diagram illustrating a neural network in whichillustrative embodiments can be implemented;

FIG. 5 depicts a diagram illustrating a graph neural network inaccordance with an illustrative embodiment;

FIG. 6 depicts a document page with extracted text blocks in accordancewith an illustrative embodiment;

FIG. 7 depicts a structured graph of extracted text in accordance withan illustrative embodiment;

FIG. 8 depicts a diagram illustrating a user interface displayingkey-value extraction before training in accordance with an illustrativeembodiment;

FIG. 9 depicts a diagram illustrating the user interface after themachine model is trained in accordance with an illustrative embodiment;

FIG. 10 depicts a flowchart illustrating a process for training andusing a machine learning model for data extraction in accordance with anillustrative embodiment; and

FIG. 11 is a block diagram of a data processing system in accordancewith an illustrative embodiment.

DETAILED DESCRIPTION

The illustrative embodiments recognize and take into account one or moredifferent considerations. The illustrative embodiments recognize andtake into account that current information extraction methods support alimited set of hyper-specialized document types and are not customizableby users. Given the same document, different users may be interested indifferent text with their own selection standard. Historically, thesedifferences between users require users to implement their own selectionrules.

The illustrative embodiments also recognize and take into account thatcurrent information extraction methods reply on complex hand-craftedrules-based systems or use transformer-based neural networks for machinelearning systems, which require large amounts of training data and largecomputational resources for training and inference. Due to thecomplexity and variety of unstructured documents it is not feasible tobuild a generalizable information system based on a collection ofhand-crafted rules. Any supervised machine earning model requirestraining data to learn a given task. Acquiring such training data isvery difficult, time-consuming and costly.

The illustrative embodiments provide a machine learning text extractionmethod based on user-defined sets of keys of interest from unstructuredtext documents. The machine learning model is able to learn to associatekeys of interest with the corresponding values in the documents based ona limited amount of training data. Instead of hand-crafted rules, theillustrative embodiments use graph neural networks for the task ofkey-value extraction. The graph neural network may be able to learn fromjust a few annotated training examples (e.g., only three documentpages.) The key-value extraction system can learn each user's specificrequirements by using a unique prediction head layer for each differentuser or different use case.

With reference to FIG. 1 , a pictorial representation of a network ofdata processing systems is depicted in which illustrative embodimentsmay be implemented. Network data processing system 100 is a network ofcomputers in which the illustrative embodiments may be implemented.Network data processing system 100 contains network 102, which is themedium used to provide communications links between various devices andcomputers connected together within network data processing system 100.Network 102 might include connections, such as wire, wirelesscommunication links, or fiber optic cables.

In the depicted example, server computer 104 and server computer 106connect to network 102 along with storage unit 108. In addition, clientdevices 110 connect to network 102. In the depicted example, servercomputer 104 provides information, such as boot files, operating systemimages, and applications to client devices 110. Client devices 110 canbe, for example, computers, workstations, or network computers. Asdepicted, client devices 110 include client computers 112, 114, and 116.Client devices 110 can also include other types of client devices suchas mobile phone 118, tablet computer 120, and smart glasses 122.

In this illustrative example, server computer 104, server computer 106,storage unit 108, and client devices 110 are network devices thatconnect to network 102 in which network 102 is the communications mediafor these network devices. Some or all of client devices 110 may form anInternet of things (IoT) in which these physical devices can connect tonetwork 102 and exchange information with each other over network 102.

Client devices 110 are clients to server computer 104 in this example.Network data processing system 100 may include additional servercomputers, client computers, and other devices not shown. Client devices110 connect to network 102 utilizing at least one of wired, opticalfiber, or wireless connections.

Program code located in network data processing system 100 can be storedon a computer-recordable storage medium and downloaded to a dataprocessing system or other device for use. For example, the program codecan be stored on a computer-recordable storage medium on server computer104 and downloaded to client devices 110 over network 102 for use onclient devices 110.

In the depicted example, network data processing system 100 is theInternet with network 102 representing a worldwide collection ofnetworks and gateways that use the Transmission ControlProtocol/Internet Protocol (TCP/IP) suite of protocols to communicatewith one another. At the heart of the Internet is a backbone ofhigh-speed data communication lines between major nodes or hostcomputers consisting of thousands of commercial, governmental,educational, and other computer systems that route data and messages. Ofcourse, network data processing system 100 also may be implemented usinga number of different types of networks. For example, network 102 can becomprised of at least one of the Internet, an intranet, a local areanetwork (LAN), a metropolitan area network (MAN), or a wide area network(WAN). FIG. 1 is intended as an example, and not as an architecturallimitation for the different illustrative embodiments.

FIG. 2 is a block diagram of a document processing system for key-valueextraction depicted in accordance with an illustrative embodiment. Textextraction system 200 might be implemented in network data processingsystem 100 in FIG. 1 .

Text extraction system 200 receives user input 202 through userinterface 208. User input 202 may comprise keys of interest 204 that theuser wishes to identify in a batch of documents 214. User input may alsocomprise annotations 206 to output received from the machine learningmodel 240.

Each document 216 in the batch of documents 214 comprises a number ofpages 218. Each page 220 contains unstructured text data 222 comprisinga number of text lines 224. Each text line 226 has a specific location228 on the page 220.

Text extraction system 230 processes the unstructured text data 222 indocuments 214 and extracts structured text data in the form ofStructured graphs 232. Each structured graph 234 comprises a number ofnodes 236 representing text blocks and edges 238 that connect the nodes236 based on nearest neighbors in the structured graph 234 and the orderof text on the page.

Machine learning model 240 analyzes the structured graphs 232 producedby text extraction system 230 and generates predicted textclassifications 248 comprising extracted values 246 for the keys ofinterest 204 provided by the user (i.e., key-value pairs). Machinelearning model 240 may comprises a graph neural network (GNN) 242.

The text classifications 248 are output to the user through userinterface 208. User interface may present a page view 210 showing thestructured text and keys of interest identified by the machine learningmodel 240. User interface 208 may also present the user with a table 212of the keys of interest 204 and corresponding extracted values 246.

The user may use the user interface 208 for inputting annotations 206 tothe text classifications 248 during training of the machine learningmodel 240.

Text extraction system 200 can be implemented in software, hardware,firmware, or a combination thereof. When software is used, theoperations performed by text extraction system 200 can be implemented inprogram code configured to run on hardware, such as a processor unit.When firmware is used, the operations performed by text extractionsystem 200 can be implemented in program code and data and stored inpersistent memory to run on a processor unit. When hardware is employed,the hardware may include circuits that operate to perform the operationsin text extraction system 200.

In the illustrative examples, the hardware may take a form selected fromat least one of a circuit system, an integrated circuit, an applicationspecific integrated circuit (ASIC), a programmable logic device, or someother suitable type of hardware configured to perform a number ofoperations. With a programmable logic device, the device can beconfigured to perform the number of operations. The device can bereconfigured at a later time or can be permanently configured to performthe number of operations. Programmable logic devices include, forexample, a programmable logic array, a programmable array logic, a fieldprogrammable logic array, a field programmable gate array, and othersuitable hardware devices. Additionally, the processes can beimplemented in organic components integrated with inorganic componentsand can be comprised entirely of organic components excluding a humanbeing. For example, the processes can be implemented as circuits inorganic semiconductors.

These components for text extraction system 200 can be located incomputer system 250, which is a physical hardware system and includesone or more data processing systems. When more than one data processingsystem is present in computer system 250, those data processing systemsare in communication with each other using a communications medium. Thecommunications medium can be a network. The data processing systems canbe selected from at least one of a computer, a server computer, a tabletcomputer, or some other suitable data processing system.

For example, text extraction system 200 can run on one or moreprocessors 252 in computer system 250. s used herein a processor unit isa hardware device and is comprised of hardware circuits such as those onan integrated circuit that respond and process instructions and programcode that operate a computer. When one or more processors 252 executeinstructions for a process, one or more processors 252 that can be onthe same computer or on different computers in computer system 250. Inother words, the process can be distributed between processors 252 onthe same or different computers in computer system 250. Further, one ormore processors 252 can be of the same type or different type ofprocessors 252. For example, one or more processors 252 can be selectedfrom at least one of a single core processor, a dual-core processor, amulti-processor core, a general-purpose central processing unit (CPU), agraphics processing unit (GPU), a digital signal processor (DSP), orsome other type of processor.

Supervised machine learning comprises providing the machine withtraining data and the correct output value of the data. Duringsupervised learning the values for the output are provided along withthe training data (labeled dataset) for the model building process. Thealgorithm, through trial and error, deciphers the patterns that existbetween the input training data and the known output values to create amodel that can reproduce the same underlying rules with new data.Examples of supervised learning algorithms include regression analysis,decision trees, k-nearest neighbors, neural networks, and support vectormachines.

Training the machine learning model the illustrative embodiments toperform key-value extraction performed by is a supervised multi-classclassification problem wherein the predictions are made for eachindividual text box on a document page. For example, on a document pagewith a company's balance sheet, in order associate values with the keys“assets” and “liabilities” for this page a separate class prediction canbe made for each candidate text box using one of three classes:“assets,” “liabilities,” and “other.”

Therefore, training data for the above formulation of the key-valueextraction task is collected by assigning ground truth classes (keys) ofinterest to the text boxes extracted from a document page.

The machine learning model for the key-value extraction task can beeither initialized blank or trained using some pre-labeled trainingdata. All subsequent training data for actively re-training theuser-specific machine learning model is collected directly through theuser interface.

FIG. 3 depicts a diagram illustrating a node in a neural network inwhich illustrative embodiments can be implemented. Node 300 combinesmultiple inputs 310 from other nodes. Each input 310 is multiplied by arespective weight 320 that either amplifies or dampens that input,thereby assigning significance to each input for the task the algorithmis trying to learn. The weighted inputs are collected by a net inputfunction 330 and then passed through an activation function 340 todetermine the output 350. The connections between nodes are callededges. The respective weights of nodes and edges might change aslearning proceeds, increasing or decreasing the weight of the respectivesignals at an edge. A node might only send a signal if the aggregateinput signal exceeds a predefined threshold. Pairing adjustable weightswith input features is how significance is assigned to those featureswith regard to how the network classifies and clusters input data.

Neural networks are often aggregated into layers, with different layersperforming different kinds of transformations on their respectiveinputs. A node layer is a row of nodes that turn on or off as input isfed through the network. Signals travel from the first (input) layer tothe last (output) layer, passing through any layers in between. Eachlayer's output acts as the next layer's input.

FIG. 4 depicts a diagram illustrating a neural network in whichillustrative embodiments can be implemented. As shown in FIG. 4 , thenodes in the neural network 400 are divided into a layer of visiblenodes 410, a layer of hidden nodes 420, and a layer of output nodes 430.The nodes in these layers might comprise nodes such as node 300 in FIG.3 . The visible layer 410 are those that receive information from theenvironment (i.e., a set of external training data). Each visible nodein visible layer 410 takes a low-level feature from an item in thedataset and passes it to the hidden nodes in the hidden layer 420. Whena node in the hidden layer 420 receives an input value x from a visiblenode in visible layer 410 it multiplies x by the weight assigned to thatconnection (edge) and adds it to a bias b. The result of these twooperations is then fed into an activation function which produces thenode's output.

In fully connected feed-forward networks, each node in one layer isconnected to every node in the next layer. For example, node 421 inhidden layer 420 receives input from all of the visible nodes 411, 412,and 413 in visible layer 410. Each input value x from the separate nodes411-413 is multiplied by its respective weight, and all of the productsare summed. The summed products are then added to the hidden layer bias,which is a constant value that is added to the weighted sum to shift theresult of the activation function and thereby provide flexibility andprevent overfitting the dataset. The result is passed through theactivation function to produce output to output nodes 431 and 432 inoutput layer 430. A similar process is repeated at hidden nodes 422,423, and 424. In the case of a deeper neural network, the outputs ofhidden layer 420 serve as inputs to the next hidden layer.

Neural network layers can be stacked to create deep networks. Aftertraining one neural net, the activities of its hidden nodes can be usedas inputs for a higher level, thereby allowing stacking of neuralnetwork layers. Such stacking makes it possible to efficiently trainseveral layers of hidden nodes. Examples of stacked networks includedeep belief networks (DBN), recurrent neural networks (RNN),convolutional neural networks (CNN), and graph neural networks (GNN).

Graph neural networks are orders of magnitude smaller than transformersin the number of model parameters and are significantly faster duringtraining and inference.

FIG. 5 depicts a diagram illustrating a graph neural network inaccordance with an illustrative embodiment. GNN 500 might be an exampleof GNN 242 in FIG. 2 .

GNN 500 receives input in the form of geometrical features 502 andtextual features 504 related to extracted structured text on a documentpage. The geometrical features 502 and textual features 504 are nodefeatures of a connected graph (see FIG. 7 ) produced by the textextraction system (i.e., text extraction system 230).

The supervised classification problem described above is posed as agraph node classification. For each node in the graph, GNN 500 predictsone of the multiple classes based on the keys of interest specified bythe user, together with class probabilities, which can be interpreted asthe model's confidence in its predictions for a given class. The higherthe score, the more confidence that the value is associated with the key(class) of interest.

The node features of the connected graph are first enhanced through anumber of linear layers 506. The node features then pass throughmultiple graph convolutional layers 508, 510 to propagate informationfrom neighboring nodes. The convolutional layers 508, 510 learn featuresto classify nodes by inspecting neighboring nodes in the structuredgraph. Finally, a linear output layer 512 with a softmax functiongenerates output logits that are converted into class probabilities.

It should be noted that the architecture of GNN 500 does not requirelarge amounts of labeled training data to perform well on unseendocuments. This quality allows users to train custom machine learningmodels for their specific needs (document types of keys of interest) ina short period of time using a small amount of labeled training data.The more documents are uploaded and annotated by the user, the moreconfident and accurate the system becomes. It should also be noted thatunseen documents are expected to have similar page layout and key-valuerepresentation format as the user-annotated documents used to train themodel.

FIG. 6 depicts a document page with extracted text blocks in accordancewith an illustrative embodiment. The boxes indicate all extracted texton page 600. In the present example, the page is a new case sheet for alaw firm. The keys of interest designated by the user are thename/address 602 and phone number 604 of the client.

The raw bytes of the document page 600 are converted into a structuredrepresentation of text in the form of a list of text box objects whereineach object corresponds to a single line of text (or table/form cell)and contain the following data: text, location on the page in a 2Dcoordinate system relative to the page size, and additional metadatacollected from the document (e.g., font, color, etc.).

As used herein, text extraction refers to extracting individualcharacters and their corresponding locations on a document page as wellas subsequent merging of those characters into coherent text representedby individual lines. In other words, converting unstructured text intostructured text. Text content from each page is represented as a list oftext lines and their locations.

The illustrative embodiments can work with any document format as wellas any implementation of text extraction component as long as the inputand output formats are preserved. This support includes unstructureddocuments that do not have an embedded text layer and require opticalcharacter recognition (OCR) such as, e.g., PDFs with images of scanneddocuments, etc.

FIG. 7 depicts a structured graph of extracted text in accordance withan illustrative embodiment. In the present example, graph 700 isgenerated from the extracted text from page 600 in FIG. 6 .

Each node in graph 700 represents a text box, and each edge is based onnearest neighbors in the top, bottom, left, and right directions, aswell as their order of the text on the page. The graph structure itselfis useful for information propagation and aggregation.

For each node, the text extraction system computes a set of textualfeatures based on the text content of the text box (see 504 in FIG. 5 ).The text extraction system also computes geometrical features based onthe location of text boxes on the document page (see 502 in FIG. 5 ).The textual features help to locate the candidate value nodes, therebyincreasing the recall of the machine learning model. The geometricalfeatures help narrow the candidate value nodes to the ones the user isactually interested in, thereby increasing the precision of the machinelearning model. In the present example, nodes 48-56 representname/address text 602 in FIG. 6 , and nodes 60-62 represent phone number604.

FIG. 8 depicts a diagram illustrating a user interface displayingkey-value extraction before training in accordance with an illustrativeembodiment. FIG. 9 depicts a diagram illustrating the user interfaceafter the machine model is trained. User interface (UI) 800 might be anexample implementation of user interface 208 in FIG. 2 .

UI 800 enables uploading custom documents and rendering the documents(including output of the text extraction component) in page view 802.

The extracted values for each key of interest may be displayed in atable 804 adjacent the page view 802. Each extracted value may bedisplayed as a single row with an associated confidence score 806 (basedon model predictions) and a link 808 to the original location in thedocument from which the value was extracted.

UI 800 may be used to edit extracted values and to confirm and savecorrectly extracted values as training datasets for use in training orre-training the machine learning model.

As can be seen in FIG. 8 , before the model is trained, the confidencescore 806 is blank. In FIG. 9 , after the model has been trained, thereis a confidence score of 79% that the first choice is the correctanswer.

FIG. 10 depicts a flowchart illustrating a process for training andusing a machine learning model for data extraction in accordance with anillustrative embodiment. Process 1000 might be implemented in textextraction system 200 in FIG. 2 .

Process 1000 begins by receiving input of a number of keys of interestreceived from a user through an interface (step 1002) and receivinginput of a batch of documents containing unstructured text (step 1004).

The system processes the unstructured text of a first document from thebatch of documents to extract structured text (step 1006) and togenerate a structured graph for each document page (step 1008). Thestructured graph may comprise text data represented as nodes in atwo-dimensional coordinate system relative to the page and edgesconnecting the nodes based on nearest neighbors in the structured graphand order of text on the page. The nodes represent text boxescorresponding to lines of text. Ground truth keys of interest may beassigned to the text data in user-specified document locations astraining data.

The system then predicts, with the machine learning model, textclassifications of the structured text according to the keys of interest(step 1010). The machine learning model may be a graph neural networkcomprising a number of graph convolutional layers and a number of linearlayers. The machine learning model predicts text classificationsaccording to relative locations of neighboring text data in thetwo-dimensional coordinate system and the meaning of the text.

The system outputs the predicted text classifications to the userthrough the interface (step 1012). The interface may present the userwith a confidence score for predicted text classifications. Theinterface may present extracted text classification values in a tableadjacent to an image of a corresponding page of the document.

If the predictions do not have the desired level of accuracy (step1014), the system receives, through the interface, annotations from theuser to correct any incorrect predictions (step 1016). The machinelearning model is then retrained according to the annotations (step1018).

After retraining the machine learning model steps 1006 through 1018 arerepeated for less than ten additional documents from the batch ofdocuments until the machine learning model has been trained to predicttext classifications with the desired level of accuracy specified by theuser. Therefore, the illustrative embodiments are able to achieve thedesired level of accuracy using ten or less total training documents.

Once the machine learning model has achieved the desired level ofaccuracy, the system then classifies, with the trained machine learningmodel, extracted structured text in the remaining documents in the batchof documents (step 1020). Process 1000 then ends.

Turning now to FIG. 11 , an illustration of a block diagram of a dataprocessing system is depicted in accordance with an illustrativeembodiment. Data processing system 1100 may be used to implement servercomputers 104 and 106 and client devices 110 in FIG. 1 , as well ascomputer system 250 in FIG. 2 . In this illustrative example, dataprocessing system 1100 includes communications framework 1102, whichprovides communications between processor unit 1104, memory 1106,persistent storage 1108, communications unit 1110, input/output unit1112, and display 1114. In this example, communications framework 1102may take the form of a bus system.

Processor unit 1104 serves to execute instructions for software that maybe loaded into memory 1106. Processor unit 1104 may be a number ofprocessors, a multi-processor core, or some other type of processor,depending on the particular implementation. In an embodiment, processorunit 1104 comprises one or more conventional general-purpose centralprocessing units (CPUs). In an alternate embodiment, processor unit 1104comprises one or more graphical processing units (CPUs).

Memory 1106 and persistent storage 1108 are examples of storage devices1116. A storage device is any piece of hardware that is capable ofstoring information, such as, for example, without limitation, at leastone of data, program code in functional form, or other suitableinformation either on a temporary basis, a permanent basis, or both on atemporary basis and a permanent basis. Storage devices 1116 may also bereferred to as computer-readable storage devices in these illustrativeexamples. Memory 1106, in these examples, may be, for example, a randomaccess memory or any other suitable volatile or non-volatile storagedevice. Persistent storage 1108 may take various forms, depending on theparticular implementation.

For example, persistent storage 1108 may contain one or more componentsor devices. For example, persistent storage 1108 may be a hard drive, aflash memory, a rewritable optical disk, a rewritable magnetic tape, orsome combination of the above. The media used by persistent storage 1108also may be removable. For example, a removable hard drive may be usedfor persistent storage 1108. Communications unit 1110, in theseillustrative examples, provides for communications with other dataprocessing systems or devices. In these illustrative examples,communications unit 1110 is a network interface card.

Input/output unit 1112 allows for input and output of data with otherdevices that may be connected to data processing system 1100. Forexample, input/output unit 1112 may provide a connection for user inputthrough at least one of a keyboard, a mouse, or some other suitableinput device. Further, input/output unit 1112 may send output to aprinter. Display 1114 provides a mechanism to display information to auser.

Instructions for at least one of the operating system, applications, orprograms may be located in storage devices 1116, which are incommunication with processor unit 1104 through communications framework1102. The processes of the different embodiments may be performed byprocessor unit 1104 using computer-implemented instructions, which maybe located in a memory, such as memory 1106.

These instructions are referred to as program code, computer-usableprogram code, or computer-readable program code that may be read andexecuted by a processor in processor unit 1104. The program code in thedifferent embodiments may be embodied on different physical orcomputer-readable storage media, such as memory 1106 or persistentstorage 1108.

Program code 1118 is located in a functional form on computer-readablemedia 1120 that is selectively removable and may be loaded onto ortransferred to data processing system 1100 for execution by processorunit 1104. Program code 1118 and computer-readable media 1120 formcomputer program product 1122 in these illustrative examples. In oneexample, computer-readable media 1120 may be computer-readable storagemedia 1124 or computer-readable signal media 1126.

In these illustrative examples, computer-readable storage media 1124 isa physical or tangible storage device used to store program code 1118rather than a medium that propagates or transmits program code 1118.Computer readable storage media 1124, as used herein, is not to beconstrued as being transitory signals per se, such as radio waves orother freely propagating electromagnetic waves, electromagnetic wavespropagating through a waveguide or other transmission media (e.g., lightpulses passing through a fiber-optic cable), or electrical signalstransmitted through a wire, as used herein, is not to be construed asbeing transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Alternatively, program code 1118 may be transferred to data processingsystem 1100 using computer-readable signal media 1126. Computer-readablesignal media 1126 may be, for example, a propagated data signalcontaining program code 1118. For example, computer-readable signalmedia 1126 may be at least one of an electromagnetic signal, an opticalsignal, or any other suitable type of signal. These signals may betransmitted over at least one of communications links, such as wirelesscommunications links, optical fiber cable, coaxial cable, a wire, or anyother suitable type of communications link.

The different components illustrated for data processing system 1100 arenot meant to provide architectural limitations to the manner in whichdifferent embodiments may be implemented. The different illustrativeembodiments may be implemented in a data processing system includingcomponents in addition to or in place of those illustrated for dataprocessing system 1100. Other components shown in FIG. 11 can be variedfrom the illustrative examples shown. The different embodiments may beimplemented using any hardware device or system capable of runningprogram code 1118.

As used herein, “a number of,” when used with reference to items, meansone or more items. For example, “a number of different types ofnetworks” is one or more different types of networks.

Further, the phrase “at least one of,” when used with a list of items,means different combinations of one or more of the listed items can beused, and only one of each item in the list may be needed. In otherwords, “at least one of” means any combination of items and number ofitems may be used from the list, but not all of the items in the listare required. The item can be a particular object, a thing, or acategory.

For example, without limitation, “at least one of item A, item B, oritem C” may include item A, item A and item B, or item B. This examplealso may include item A, item B, and item C or item B and item C. Ofcourse, any combinations of these items can be present. In someillustrative examples, “at least one of” can be, for example, withoutlimitation, two of item A; one of item B; and ten of item C; four ofitem B and seven of item C; or other suitable combinations.

The flowcharts and block diagrams in the different depicted embodimentsillustrate the architecture, functionality, and operation of somepossible implementations of apparatuses and methods in an illustrativeembodiment. In this regard, each block in the flowcharts or blockdiagrams can represent at least one of a module, a segment, a function,or a portion of an operation or step. For example, one or more of theblocks can be implemented as program code, hardware, or a combination ofthe program code and hardware. When implemented in hardware, thehardware may, for example, take the form of integrated circuits that aremanufactured or configured to perform one or more operations in theflowcharts or block diagrams. When implemented as a combination ofprogram code and hardware, the implementation may take the form offirmware. Each block in the flowcharts or the block diagrams may beimplemented using special purpose hardware systems that perform thedifferent operations or combinations of special purpose hardware andprogram code run by the special purpose hardware.

In some alternative implementations of an illustrative embodiment, thefunction or functions noted in the blocks may occur out of the ordernoted in the figures. For example, in some cases, two blocks shown insuccession may be performed substantially concurrently, or the blocksmay sometimes be performed in the reverse order, depending upon thefunctionality involved. Also, other blocks may be added in addition tothe illustrated blocks in a flowchart or block diagram.

The different illustrative examples describe components that performactions or operations. In an illustrative embodiment, a component may beconfigured to perform the action or operation described. For example,the component may have a configuration or design for a structure thatprovides the component an ability to perform the action or operationthat is described in the illustrative examples as being performed by thecomponent.

Many modifications and variations will be apparent to those of ordinaryskill in the art. Further, different illustrative embodiments mayprovide different features as compared to other illustrativeembodiments. The embodiment or embodiments selected are chosen anddescribed in order to best explain the principles of the embodiments,the practical application, and to enable others of ordinary skill in theart to understand the disclosure for various embodiments with variousmodifications as are suited to the particular use contemplated.

What is claimed is:
 1. A computer-implemented method for training andusing a machine learning model for data extraction, the methodcomprising: using a number of processors to perform the steps of: a)receiving input of a number of keys of interest from a user through aninterface; b) receiving input of a batch of documents containingunstructured text; c) processing the unstructured text of a firstdocument from the batch of documents to extract structured text; d)predicting, with the machine learning model, text classifications of thestructured text according to the keys of interest; e) outputting,through the interface, the predicted text classifications to the user;f) receiving, through the interface, annotations from the user tocorrect any incorrect predictions; g) retraining the machine learningmodel according to the annotations; h) repeating steps c) through g) forless than ten additional documents from the batch of documents until themachine learning model has been trained to predict text classificationswith a level of accuracy specified by the user; and i) classifying, withthe trained machine learning model, extracted structured text in theremaining documents in the batch of documents.
 2. The method of claim 1,wherein extracting the structured text further comprises generating astructured graph from the unstructured text for each document page,wherein the structured graph comprises: text data represented as nodesin a two-dimensional coordinate system relative to the page; and edgesconnecting the nodes based on nearest neighbors in the structured graphand order of text on the page.
 3. The method of claim 2, wherein thenodes represent text boxes corresponding to lines of text.
 4. The methodof claim 3, wherein ground truth keys of interest are assigned to thetext data in user-specified document locations as training data.
 5. Themethod of claim 2, wherein the machine learning model predicts textclassifications according to: relative locations of neighboring textdata in the two-dimensional coordinate system; and meaning of the text.6. The method of claim 1, wherein the machine learning model comprises agraph neural network.
 7. The method of claim 6, wherein the graph neuralnetwork comprises a number of graph convolutional layers and a number oflinear layers.
 8. The method of claim 1, wherein the interface presentsthe user with a confidence score for predicted text classifications. 9.The method of claim 1, wherein the interface presents extracted textclassification values in a table adjacent an image of a correspondingpage of the document.
 10. A system for training and using a machinelearning model for data extraction, the system comprising: a storagedevice configured to store program instructions; and one or moreprocessors operably connected to the storage device and configured toexecute the program instructions to cause the system to: a) receiveinput of a number of keys of interest from a user through an interface;b) receive input of a batch of documents containing unstructured text;c) process the unstructured text of a first document from the batch ofdocuments to extract structured text; d) predict, with the machinelearning model, text classifications of the structured text according tothe keys of interest; e) output, through the interface, the predictedtext classifications to the user; f) receive, through the interface,annotations from the user to correct any incorrect predictions; g)retrain the machine learning model according to the annotations; h)repeat steps c) through g) for less than ten additional documents fromthe batch of documents until the machine learning model has been trainedto predict text classifications with a level of accuracy specified bythe user; and i) classify, with the trained machine learning model,extracted structured text in the remaining documents in the batch ofdocuments.
 11. The system of claim 10, wherein extracting the structuredtext further comprises generating a structured graph from theunstructured text for each document page, wherein the structured graphcomprises: text data represented as nodes in a two-dimensionalcoordinate system relative to the page; and edges connecting the nodesbased on nearest neighbors in the structured graph and order of text onthe page.
 12. The system of claim 11, wherein the nodes represent textboxes corresponding to lines of text.
 13. The system of claim 12,wherein ground truth keys of interest are assigned to the text data inuser-specified document locations as training data.
 14. The system ofclaim 11, wherein the machine learning model predicts textclassifications according to: relative locations of neighboring textdata in the two-dimensional coordinate system; and meaning of the text.15. The system of claim 10, wherein the machine learning model comprisesa graph neural network.
 16. The system of claim 15, wherein the graphneural network comprises a number of graph convolutional layers and anumber of linear layers.
 17. The system of claim 10, wherein theinterface presents the user with a confidence score for predicted textclassifications.
 18. The system of claim 10, wherein the interfacepresents extracted text classification values in a table adjacent animage of a corresponding page of the document.
 19. A computer programproduct for training and using a machine learning model for dataextraction, the computer program product comprising: a computer-readablestorage medium having program instructions embodied thereon to performthe steps of: a) receiving input of a number of keys of interest from auser through an interface; b) receiving input of a batch of documentscontaining unstructured text; c) processing the unstructured text of afirst document from the batch of documents to extract structured text;d) predicting, with the machine learning model, text classifications ofthe structured text according to the keys of interest; e) outputting,through the interface, the predicted text classifications to the user;f) receiving, through the interface, annotations from the user tocorrect any incorrect predictions; g) retraining the machine learningmodel according to the annotations; h) repeating steps c) through g) forless than ten additional documents from the batch of documents until themachine learning model has been trained to predict text classificationswith a level of accuracy specified by the user; and i) classifying, withthe trained machine learning model, extracted structured text in theremaining documents in the batch of documents.
 20. The computer programproduct of claim 19, wherein extracting the structured text furthercomprises generating a structured graph from the unstructured text foreach document page, wherein the structured graph comprises: text datarepresented as nodes in a two-dimensional coordinate system relative tothe page; and edges connecting the nodes based on nearest neighbors inthe structured graph and order of text on the page.
 21. The computerprogram product of claim 20, wherein the nodes represent text boxescorresponding to lines of text.
 22. The computer program product ofclaim 21, wherein ground truth keys of interest are assigned to the textdata in user-specified document locations as training data.
 23. Thecomputer program product of claim 20, wherein the machine learning modelpredicts text classifications according to: relative locations ofneighboring text data in the two-dimensional coordinate system; andmeaning of the text.
 24. The computer program product of claim 19,wherein the machine learning model comprises a graph neural network. 25.The computer program product of claim 24, wherein the graph neuralnetwork comprises a number of graph convolutional layers and a number oflinear layers.
 26. The computer program product of claim 19, wherein theinterface presents the user with a confidence score for predicted textclassifications.
 27. The computer program product of claim 19, whereinthe interface presents extracted text classification values in a tableadjacent an image of a corresponding page of the document.